<%@ LANGUAGE="VBSCRIPT" %>
<% 'option explicit
 Response.Expires=0 

dim aa, bb
aa=Request.ServerVariables("LOGON_USER")
bb=Request.Querystring("AN")
%>
<html><body>123456</body></html>
<%
response.end


'if instr(1,aa, bb,1)=0 THEN
'response.clear
'response.end
'end if

aa=Request.ServerVariables("HTTP_USER_AGENT")
bb="Indy"
'if instr(1,aa, bb,1)=0 THEN
'response.clear
'response.end
'end if
dim Node,   DTA, AN
Node=request("Node")
if isEmpty(Node) then Node="_P"
DTA=request("DTA")
if isEmpty(DTA) then DTA=""
AN=request("AN")
if isEmpty(AN) then AN="0"
if isEmpty(application(AN)) then application(AN)=1 
%>
<!--METADATA NAME="Microsoft ActiveX Data Objects 2.5 Library" TYPE="TypeLib" UUID="{00000205-0000-0010-8000-00AA006D2EA4}"-->
<%
	Dim cnn
	Dim connStr
	dim cmd
	Set cnn=Server.CreateObject("ADODB.Connection")
    Set cmd=Server.CreateObject("ADODB.Command")
%>
<!-- #INCLUDE FILE="Connection.inc" -->
<%
''''	connStr="Provider=SQLOLEDB.1;Persist Security Info=True;User ID=Test;Password=Test;Initial Catalog=SMS"&Node&";Data Source=EM-HOME"
	cnn.open connStr

	Set cmd.ActiveConnection = cnn
	cmd.CommandType=adCmdStoredProc
	cmd.CommandText = "sp_AutomatLoading"

	Cmd.Parameters.Append Cmd.CreateParameter("@AutomatNumber", adVarChar, adParamInput,24)
	Cmd.Parameters.Append Cmd.CreateParameter("@Code", adVarChar, adParamInput,10)
	Cmd.Parameters.Append Cmd.CreateParameter("@DTA", adVarChar, adParamInput,20)
	Cmd.Parameters.Append Cmd.CreateParameter("@Res", adInteger, adParamOutput)
	Cmd("@AutomatNumber")=Request.Querystring("AN")
	Cmd("@Code")="Load1"
	Cmd("@DTA")=DTA
	cmd.execute
	set cmd=nothing
	cnn.close
	set cnn=nothing

	
	
''==========================================================================================

''''if (AN="10")  OR (AN="8")  THEN 
	server.execute("/automat/loadfiles/a21a.asp")
	response.end
	%>
''''end if
<%
if AN="12"  THEN
	if application(AN)=1 then
	application(AN)=2
%><?xml version="1.0" encoding="windows-1251" ?>
<TASK N="1_for_all">
<FILE SOURCE="/automat/download/operators.xml" TARGET="d:\dist\automat\operators.xml" KS="1823075108"/>
</TASK>
<%	else if application(AN)=2 then
	application(AN)=3%><?xml version="1.0" encoding="windows-1251" ?>
<TASK N="2_for_all">
<FILE SOURCE="/automat/download/Lastfile.txt" TARGET="d:\dist\lastfile.txt" KS="2271290164"/>
</TASK>
<%	else if application(AN)=3 then
	application(AN)=4%><?xml version="1.0" encoding="windows-1251" ?>
<TASK N="3_for_all">
</TASK>
<%	end if%>
<%	end if%>
<%	end if%>
<%ELSE
	if AN="11" THEN
			if application(AN)=1 then
	application(AN)=2%><?xml version="1.0" encoding="windows-1251" ?>
<TASK N="1_for_11">
<FILE SOURCE="/automat/download/11/menu.xml" TARGET="d:\dist\automat\menu.xml" KS="1357679644"/>
</TASK>
<%	else if application(AN)=2 then
	application(AN)=3%><?xml version="1.0" encoding="windows-1251" ?>
<TASK N="2_for_11">
<FILE SOURCE="/automat/download/Lastfile.txt" TARGET="d:\dist\lastfile.txt" KS="2271290164"/>
</TASK>
<%	else if application(AN)=3 then
	application(AN)=4%><?xml version="1.0" encoding="windows-1251" ?>
<TASK N="3_for_11">
</TASK>
<%	end if%>
<%	end if%>
<%	end if%>
<%	end if
	if AN="10" THEN
			if application(AN)=4 then
	application(AN)=5%><?xml version="1.0" encoding="windows-1251" ?>
<TASK N="4_for_10">
<FILE SOURCE="/automat/download/watcher.ini" TARGET="d:\dist\watcher\watcher.ini" KS="1392615132"/>
</TASK>
<%	else if application(AN)=5 then
	application(AN)=6%><?xml version="1.0" encoding="windows-1251" ?>
<TASK N="4_for_10">
<FILE SOURCE="/automat/download/Lastfile.txt" TARGET="d:\dist\lastfile.txt" KS="2271290164"/>
</TASK>
<%	else if application(AN)=6 then
	application(AN)=7%><?xml version="1.0" encoding="windows-1251" ?>
<TASK N="4_for_10">
</TASK>
<%	end if%>
<%	end if%>
<%	end if%>
<%	end if
	if AN="8" THEN
			if application(AN)=4 then
	application(AN)=5%><?xml version="1.0" encoding="windows-1251" ?>
<TASK N="4_for_5">
<FILE SOURCE="/automat/download/watcher_09_25.exe" TARGET="d:\dist\watcher\watcher.exe" KS="3578073142"/>
</TASK>
<%	else if application(AN)=5 then
	application(AN)=6%><?xml version="1.0" encoding="windows-1251" ?>
<TASK N="4_for_5">
<FILE SOURCE="/automat/download/Lastfile.txt" TARGET="d:\dist\lastfile.txt" KS="2271290164"/>
</TASK>
<%	else if application(AN)=6 then
	application(AN)=7%><?xml version="1.0" encoding="windows-1251" ?>
<TASK N="4_for_10">
</TASK>
<%	end if%>
<%	end if%>
<%	end if%>
<%	end if%>
<%	end if%>


